import request from '@/router/axios';

export function fetchList(query) {
  return request({
    url: '/clientauth/client/page',
    method: 'get',
    params: query
  });
}

export function getClientByUserId(id) {
  return request({
    url: '/clientauth/client/getAppByUserId/' + id,
    method: 'get'
  });
}

export function getClientIdByRoleId(id) {
  return request({
    url: '/clientauth/client/getAppIdByRoleId/' + id,
    method: 'get'
  });
}

export function getAllClient() {
  return request({
    url: '/clientauth/client/getAllAppId',
    method: 'get'
  });
}

export function addObj(obj) {
  return request({
    url: '/clientauth/client/',
    method: 'post',
    data: obj
  });
}

export function getObj(id) {
  return request({
    url: '/clientauth/client/' + id,
    method: 'get'
  });
}

export function delObj(id) {
  return request({
    url: '/clientauth/client/' + id,
    method: 'delete'
  });
}

export function putObj(obj) {
  return request({
    url: '/clientauth/client',
    method: 'put',
    data: obj
  });
}
